#include "exitfullscreenevent.h"
#include <QKeyEvent>

ExitFullScreenEvent::ExitFullScreenEvent(QObject *parent) : QObject(parent)
{

}

bool ExitFullScreenEvent::eventFilter(QObject *watched, QEvent *event)
{
    //双击退出
    if(event->type()==QEvent::MouseButtonDblClick){
        emit ExitFullScreen();
    }
    //esc按键退出
    QKeyEvent *keyevent=static_cast<QKeyEvent*>(event);
    if(keyevent->key()==Qt::Key_Escape){
        emit ExitFullScreen();
    }
}
